/*! Copyright 2010-2014 R. Torsten Clay N4OGW

   This file is part of so2sdr.

    so2sdr is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    any later version.

    so2sdr is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with so2sdr.  If not, see <http://www.gnu.org/licenses/>.

 */
#ifndef RADIODIALOG_H
#define RADIODIALOG_H

#include "ui_radiodialog.h"
#include "defines.h"
#include "serial.h"
#include <QFile>
#include <QSettings>

class QComboBox;
class QLineEdit;

/*!
   Radio serial communication parameters
 */
class RadioDialog : public QDialog, public Ui::RadioDialog
{
Q_OBJECT

public:
    RadioDialog(QSettings& s,RigSerial& cat, QWidget *parent = 0);
    ~RadioDialog();

signals:
    void startRadios();
    void setParallelPort();
    void setOTRSP();
    void setMicroHam();

public slots:
    void rejectChanges();
    void updateRadio();

private slots:
    void populateModels1(int);
    void populateModels2(int);

private:
    void populateModelCombo(int, int);
    void updateFromSettings();

    QComboBox  *radioBaudComboBox[NRIG];
    QComboBox  *radioMfgComboBox[NRIG];
    QComboBox  *radioModelComboBox[NRIG];
    QComboBox  *radioPttComboBox[NRIG];
    QLineEdit  *radioDevEdit[NRIG];
    QLineEdit  *radioPollTimeEdit[NRIG];
    QSettings&  settings;
    RigSerial&  catptr;
};

#endif
